chrome.runtime.onMessage.addListener(({ action, url, filename }, sender, sendResponse) => {
  if (action === 'download') {
    chrome.downloads.download({
      url: url,
      filename: filename,
      conflictAction: 'uniquify',
      saveAs: true
    });
  }
});
